import datetime
from applications.extensions import db


class software_web(db.Model):
    __tablename__ = 'admin_software'

    id = db.Column(db.Integer, primary_key=True, comment='ID')  # 自动生成 id 主键
    filename = db.Column(db.Text, unique=False, nullable=False, comment='文件名称')
    version = db.Column(db.Text, unique=True, nullable=False, comment='版本号')
    size = db.Column(db.Text, nullable=True, default='0MB', comment='文件大小')
    platform = db.Column(db.Text, nullable=True, default='Windows', comment='软件平台')
    description = db.Column(db.Text, nullable=False, comment='文件描述')
    url = db.Column(db.Text, nullable=True, default='/', comment='下载地址')
    enable = db.Column(db.Integer, default=0, comment='可修改') # 0 可修改 1 不可修改
    upload_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='更新日期')
    count = db.Column(db.Integer, default=0, comment='下载次数')
    
